"use client"

import {DEFAULT_VALUE} from "@/lib/constants";
import BasicInfo from "@/components/module/basic-info";
import {Button} from "@/components/ui/button";
import DetailInfo from "@/components/detail-info";
import {useState} from "react";

const Editor = () => {
    const [basicInfo, setBasicInfo] = useState(DEFAULT_VALUE?.basicInfo);
    const [detailData, setDetailData] = useState(DEFAULT_VALUE?.detailInfo);

    const handleSave = () => {
        console.log({
            basicInfo,
            detailData
        })
    }

    return (
        <div className={'space-y-4'}>
            <BasicInfo state={basicInfo} setState={setBasicInfo}/>
            <DetailInfo detailData={detailData} setDetailData={setDetailData}/>
            <Button onClick={handleSave}>
                保存
            </Button>
        </div>
    )
}

export default Editor;